package lucius.work.dao.impl;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import lucius.work.dao.*;
import lucius.work.entity.*;

@Repository("userDao")
public class UserDaoImpl extends BaseDao<User> implements UserDao {


	public User findByUserName(String username, String password) {
		Session session = sessionFactory.getCurrentSession();
		User u = (User) session.createQuery("FROM user u WHERE u.username=:username and u.password =:password")
				.setParameter("username", username).setParameter("password", password).uniqueResult();
		return u;
	}

}
